<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*
        JSONP:  it means 'JSON with padding'
     */
    function handleResponse(response) {
        console.log(`You're at IP address ${response.ip}, which is in ${response.city}, ${response.region_name}`);
    }

    let script = document.createElement("script");
    script.src = "http://freegeoip.net/json/?callback=handleResponse";
    document.body.insertBefore(script, document.body.firstChild);
</script>
</body>
</html>